package com.wanxi.repertory.service.api.feign;

import com.github.pagehelper.PageInfo;
import com.sun.org.glassfish.external.probe.provider.annotations.ProbeParam;
import com.wanxi.repertory.service.api.dto.RepertoryUserDto;
import com.wanxi.repertory.service.api.dto.RepertoryUserPageDto;
import com.wanxi.repertory.service.api.entity.RepertoryUser;
import com.wanxi.repertory.service.api.result.CommonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @Author:wgy
 * @Data：2022/1/18 14:27
 */
@FeignClient(value = "repertory-server",path = "user/repertory")
public interface RepertoryUserService {

    @GetMapping("findRepertory")
    CommonResult<PageInfo<RepertoryUser>> findRepertory(@RequestBody RepertoryUserPageDto repertoryUserPageDto);

    @GetMapping("updateBatch")
    CommonResult<Integer> updateBatch(List<RepertoryUserDto> list);

    /**
     * 根据skuId查找库存
     * @param skuId
     * @return
     */
    @GetMapping("findRepertoryBySkuId")
    CommonResult<Boolean> findRepertoryBySkuId(@ProbeParam("skuId") Long skuId);

    /**
     * 根据sku id查找店铺id
     * @param skuId
     * @return
     */
    @GetMapping("/sku/findShopIdBySkuId")
    CommonResult<Long> findShopIdBySkuId(@RequestParam(name = "skuId") Long skuId);

}
